package com.heima.search.service;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.search.dto.SearchDto;
import com.heima.model.search.enums.AppArticleInfo;
import com.heima.search.dto.ApAssociateSearchDto;
import com.heima.search.dto.HistorySearchDto;
import com.heima.search.pojo.ApAssociateWords;
import org.springframework.scheduling.annotation.Async;

import java.io.IOException;

public interface SearchService {
    //根据关键字查询文章
    ResponseResult  searchByKey(SearchDto searchDto) throws IOException;

    //监听app文章服务,同步数据到es
    void   addApplication(AppArticleInfo appArticleInfo);

    //历史搜索记录放入mongodb中
    @Async("DefaultThreadPool")
    void  addSearchDataMongodb(String searchWords,Integer userId);

    //查询搜索数据
    ResponseResult querySearchData();


    ResponseResult deleteSearch(HistorySearchDto historySearchDto);

    ResponseResult queryAssociate(ApAssociateSearchDto apAssociateSearchDto);

}
